/**
 */
package org.mro.grib.model.files.secondEdition.dataRepresentations.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.mro.grib.model.files.secondEdition.dataRepresentations.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class DataRepresentationsFactoryImpl extends EFactoryImpl implements DataRepresentationsFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static DataRepresentationsFactory init() {
		try {
			DataRepresentationsFactory theDataRepresentationsFactory = (DataRepresentationsFactory)EPackage.Registry.INSTANCE.getEFactory(DataRepresentationsPackage.eNS_URI);
			if (theDataRepresentationsFactory != null) {
				return theDataRepresentationsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new DataRepresentationsFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationsFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE50: return createDataRepresentationTemplate50();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51: return createDataRepresentationTemplate51();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52: return createDataRepresentationTemplate52();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE53: return createDataRepresentationTemplate53();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE54: return createDataRepresentationTemplate54();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE55: return createDataRepresentationTemplate55();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE541: return createDataRepresentationTemplate541();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE550: return createDataRepresentationTemplate550();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE551: return createDataRepresentationTemplate551();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE561: return createDataRepresentationTemplate561();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE5200: return createDataRepresentationTemplate5200();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE_NUMBER:
				return createDataRepresentationTemplateNumberFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE_NUMBER:
				return convertDataRepresentationTemplateNumberToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate50 createDataRepresentationTemplate50() {
		DataRepresentationTemplate50Impl dataRepresentationTemplate50 = new DataRepresentationTemplate50Impl();
		return dataRepresentationTemplate50;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate51 createDataRepresentationTemplate51() {
		DataRepresentationTemplate51Impl dataRepresentationTemplate51 = new DataRepresentationTemplate51Impl();
		return dataRepresentationTemplate51;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate52 createDataRepresentationTemplate52() {
		DataRepresentationTemplate52Impl dataRepresentationTemplate52 = new DataRepresentationTemplate52Impl();
		return dataRepresentationTemplate52;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate53 createDataRepresentationTemplate53() {
		DataRepresentationTemplate53Impl dataRepresentationTemplate53 = new DataRepresentationTemplate53Impl();
		return dataRepresentationTemplate53;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate54 createDataRepresentationTemplate54() {
		DataRepresentationTemplate54Impl dataRepresentationTemplate54 = new DataRepresentationTemplate54Impl();
		return dataRepresentationTemplate54;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate55 createDataRepresentationTemplate55() {
		DataRepresentationTemplate55Impl dataRepresentationTemplate55 = new DataRepresentationTemplate55Impl();
		return dataRepresentationTemplate55;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate541 createDataRepresentationTemplate541() {
		DataRepresentationTemplate541Impl dataRepresentationTemplate541 = new DataRepresentationTemplate541Impl();
		return dataRepresentationTemplate541;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate550 createDataRepresentationTemplate550() {
		DataRepresentationTemplate550Impl dataRepresentationTemplate550 = new DataRepresentationTemplate550Impl();
		return dataRepresentationTemplate550;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate551 createDataRepresentationTemplate551() {
		DataRepresentationTemplate551Impl dataRepresentationTemplate551 = new DataRepresentationTemplate551Impl();
		return dataRepresentationTemplate551;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate561 createDataRepresentationTemplate561() {
		DataRepresentationTemplate561Impl dataRepresentationTemplate561 = new DataRepresentationTemplate561Impl();
		return dataRepresentationTemplate561;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplate5200 createDataRepresentationTemplate5200() {
		DataRepresentationTemplate5200Impl dataRepresentationTemplate5200 = new DataRepresentationTemplate5200Impl();
		return dataRepresentationTemplate5200;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationTemplateNumber createDataRepresentationTemplateNumberFromString(EDataType eDataType, String initialValue) {
		DataRepresentationTemplateNumber result = DataRepresentationTemplateNumber.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertDataRepresentationTemplateNumberToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataRepresentationsPackage getDataRepresentationsPackage() {
		return (DataRepresentationsPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static DataRepresentationsPackage getPackage() {
		return DataRepresentationsPackage.eINSTANCE;
	}

} //DataRepresentationsFactoryImpl
